package ProjetCorba;

/**
 * Interface definition : Transporteur
 * 
 * @author OpenORB Compiler
 */
public class _TransporteurStub extends org.omg.CORBA.portable.ObjectImpl
        implements Transporteur
{
    static final String[] _ids_list =
    {
        "IDL:ProjetCorba/Transporteur:1.0"
    };

    public String[] _ids()
    {
     return _ids_list;
    }

    private final static Class _opsClass = ProjetCorba.TransporteurOperations.class;

    /**
     * Read accessor for numTra attribute
     * @return the attribute value
     */
    public short numTra()
    {
        while(true)
        {
            if (!this._is_local())
            {
                org.omg.CORBA.portable.InputStream _input = null;
                try {
                    org.omg.CORBA.portable.OutputStream _output = this._request("_get_numTra",true);
                    _input = this._invoke(_output);
                    return _input.read_short();
                } catch (final org.omg.CORBA.portable.RemarshalException _exception) {
                    continue;
                } catch (final org.omg.CORBA.portable.ApplicationException _exception) {
                    final String _exception_id = _exception.getId();
                    throw new org.omg.CORBA.UNKNOWN("Unexpected User Exception: "+ _exception_id);
                } finally {
                    this._releaseReply(_input);
                }
            }
            else
            {
                org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke("_get_numTra",_opsClass);
                if (_so == null)
                   continue;
                ProjetCorba.TransporteurOperations _self = (ProjetCorba.TransporteurOperations) _so.servant;
                try
                {
                    return _self.numTra();
                }
                finally
                {
                    _servant_postinvoke(_so);
                }
            }
        }
    }

    /**
     * Operation retraitColis
     */
    public void retraitColis(short idTra)
        throws ProjetCorba.TransporteurPackage.Tra_Inconnu
    {
        while(true)
        {
            if (!this._is_local())
            {
                org.omg.CORBA.portable.InputStream _input = null;
                try
                {
                    org.omg.CORBA.portable.OutputStream _output = this._request("retraitColis",true);
                    _output.write_short(idTra);
                    _input = this._invoke(_output);
                    return;
                }
                catch(org.omg.CORBA.portable.RemarshalException _exception)
                {
                    continue;
                }
                catch(org.omg.CORBA.portable.ApplicationException _exception)
                {
                    String _exception_id = _exception.getId();
                    if (_exception_id.equals(ProjetCorba.TransporteurPackage.Tra_InconnuHelper.id()))
                    {
                        throw ProjetCorba.TransporteurPackage.Tra_InconnuHelper.read(_exception.getInputStream());
                    }

                    throw new org.omg.CORBA.UNKNOWN("Unexpected User Exception: "+ _exception_id);
                }
                finally
                {
                    this._releaseReply(_input);
                }
            }
            else
            {
                org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke("retraitColis",_opsClass);
                if (_so == null)
                   continue;
                ProjetCorba.TransporteurOperations _self = (ProjetCorba.TransporteurOperations) _so.servant;
                try
                {
                    _self.retraitColis( idTra);
                    return;
                }
                finally
                {
                    _servant_postinvoke(_so);
                }
            }
        }
    }

    /**
     * Operation deposerColis
     */
    public void deposerColis(short idTra)
        throws ProjetCorba.TransporteurPackage.Tra_Inconnu, ProjetCorba.TransporteurPackage.Sta_Erreur, ProjetCorba.TransporteurPackage.Sta_Pleine
    {
        while(true)
        {
            if (!this._is_local())
            {
                org.omg.CORBA.portable.InputStream _input = null;
                try
                {
                    org.omg.CORBA.portable.OutputStream _output = this._request("deposerColis",true);
                    _output.write_short(idTra);
                    _input = this._invoke(_output);
                    return;
                }
                catch(org.omg.CORBA.portable.RemarshalException _exception)
                {
                    continue;
                }
                catch(org.omg.CORBA.portable.ApplicationException _exception)
                {
                    String _exception_id = _exception.getId();
                    if (_exception_id.equals(ProjetCorba.TransporteurPackage.Tra_InconnuHelper.id()))
                    {
                        throw ProjetCorba.TransporteurPackage.Tra_InconnuHelper.read(_exception.getInputStream());
                    }

                    if (_exception_id.equals(ProjetCorba.TransporteurPackage.Sta_ErreurHelper.id()))
                    {
                        throw ProjetCorba.TransporteurPackage.Sta_ErreurHelper.read(_exception.getInputStream());
                    }

                    if (_exception_id.equals(ProjetCorba.TransporteurPackage.Sta_PleineHelper.id()))
                    {
                        throw ProjetCorba.TransporteurPackage.Sta_PleineHelper.read(_exception.getInputStream());
                    }

                    throw new org.omg.CORBA.UNKNOWN("Unexpected User Exception: "+ _exception_id);
                }
                finally
                {
                    this._releaseReply(_input);
                }
            }
            else
            {
                org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke("deposerColis",_opsClass);
                if (_so == null)
                   continue;
                ProjetCorba.TransporteurOperations _self = (ProjetCorba.TransporteurOperations) _so.servant;
                try
                {
                    _self.deposerColis( idTra);
                    return;
                }
                finally
                {
                    _servant_postinvoke(_so);
                }
            }
        }
    }

    /**
     * Operation selectionnerColisTra
     */
    public void selectionnerColisTra()
        throws ProjetCorba.TransporteurPackage.Col_Selec
    {
        while(true)
        {
            if (!this._is_local())
            {
                org.omg.CORBA.portable.InputStream _input = null;
                try
                {
                    org.omg.CORBA.portable.OutputStream _output = this._request("selectionnerColisTra",true);
                    _input = this._invoke(_output);
                    return;
                }
                catch(org.omg.CORBA.portable.RemarshalException _exception)
                {
                    continue;
                }
                catch(org.omg.CORBA.portable.ApplicationException _exception)
                {
                    String _exception_id = _exception.getId();
                    if (_exception_id.equals(ProjetCorba.TransporteurPackage.Col_SelecHelper.id()))
                    {
                        throw ProjetCorba.TransporteurPackage.Col_SelecHelper.read(_exception.getInputStream());
                    }

                    throw new org.omg.CORBA.UNKNOWN("Unexpected User Exception: "+ _exception_id);
                }
                finally
                {
                    this._releaseReply(_input);
                }
            }
            else
            {
                org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke("selectionnerColisTra",_opsClass);
                if (_so == null)
                   continue;
                ProjetCorba.TransporteurOperations _self = (ProjetCorba.TransporteurOperations) _so.servant;
                try
                {
                    _self.selectionnerColisTra();
                    return;
                }
                finally
                {
                    _servant_postinvoke(_so);
                }
            }
        }
    }

    /**
     * Operation payer
     */
    public void payer(float montant)
    {
        while(true)
        {
            if (!this._is_local())
            {
                org.omg.CORBA.portable.InputStream _input = null;
                try
                {
                    org.omg.CORBA.portable.OutputStream _output = this._request("payer",true);
                    _output.write_float(montant);
                    _input = this._invoke(_output);
                    return;
                }
                catch(org.omg.CORBA.portable.RemarshalException _exception)
                {
                    continue;
                }
                catch(org.omg.CORBA.portable.ApplicationException _exception)
                {
                    String _exception_id = _exception.getId();
                    throw new org.omg.CORBA.UNKNOWN("Unexpected User Exception: "+ _exception_id);
                }
                finally
                {
                    this._releaseReply(_input);
                }
            }
            else
            {
                org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke("payer",_opsClass);
                if (_so == null)
                   continue;
                ProjetCorba.TransporteurOperations _self = (ProjetCorba.TransporteurOperations) _so.servant;
                try
                {
                    _self.payer( montant);
                    return;
                }
                finally
                {
                    _servant_postinvoke(_so);
                }
            }
        }
    }

    /**
     * Operation transporterColis
     */
    public void transporterColis()
    {
        while(true)
        {
            if (!this._is_local())
            {
                org.omg.CORBA.portable.InputStream _input = null;
                try
                {
                    org.omg.CORBA.portable.OutputStream _output = this._request("transporterColis",true);
                    _input = this._invoke(_output);
                    return;
                }
                catch(org.omg.CORBA.portable.RemarshalException _exception)
                {
                    continue;
                }
                catch(org.omg.CORBA.portable.ApplicationException _exception)
                {
                    String _exception_id = _exception.getId();
                    throw new org.omg.CORBA.UNKNOWN("Unexpected User Exception: "+ _exception_id);
                }
                finally
                {
                    this._releaseReply(_input);
                }
            }
            else
            {
                org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke("transporterColis",_opsClass);
                if (_so == null)
                   continue;
                ProjetCorba.TransporteurOperations _self = (ProjetCorba.TransporteurOperations) _so.servant;
                try
                {
                    _self.transporterColis();
                    return;
                }
                finally
                {
                    _servant_postinvoke(_so);
                }
            }
        }
    }

    /**
     * Operation notifierTra
     */
    public void notifierTra(String code)
    {
        while(true)
        {
            if (!this._is_local())
            {
                org.omg.CORBA.portable.InputStream _input = null;
                try
                {
                    org.omg.CORBA.portable.OutputStream _output = this._request("notifierTra",false);
                    _output.write_string(code);
                    _input = this._invoke(_output);
                    return;
                }
                catch(org.omg.CORBA.portable.RemarshalException _exception)
                {
                    continue;
                }
                catch(org.omg.CORBA.portable.ApplicationException _exception)
                {
                    String _exception_id = _exception.getId();
                    throw new org.omg.CORBA.UNKNOWN("Unexpected User Exception: "+ _exception_id);
                }
                finally
                {
                    this._releaseReply(_input);
                }
            }
            else
            {
                org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke("notifierTra",_opsClass);
                if (_so == null)
                   continue;
                ProjetCorba.TransporteurOperations _self = (ProjetCorba.TransporteurOperations) _so.servant;
                try
                {
                    _self.notifierTra( code);
                    return;
                }
                finally
                {
                    _servant_postinvoke(_so);
                }
            }
        }
    }

}
